<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE HTML>
<?php
include_once 'php/objects/person.php';
session_start();
if (!isset($_SESSION['user'])) {
    
} else {
    $user = $_SESSION['user'];
}
?>
<html lang="es">
    <head>
        <meta charset="UTF-8">
        <title>* SEPC *</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script language="JavaScript" src="js/validations.js" type="text/javascript"></script>
        <link rel="stylesheet" type="text/css" href="style/bootstrap.css">
        <link rel="stylesheet" type="text/css" href="style/bootstrap-responsive.css">
        <link rel="stylesheet" href="style/styles.css">
    </head>
    <body>
        <div class="navbar navbar-fixed-top">
            <div class="navbar-inner">
                <div class="container">
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </a>
                    <a href="index.php" class="brand"><img src="img/sepc_logo.png" alt=""></a>
                    <div class="nav-collapse">
                        <ul class="nav">
                            <li><a href="index.php">Inicio</a></li>
                            <li><a href="about.php">¿ Quienes Somos ?</a></li>
                            <li class="active"><a href="contact.php">Registro</a></li>
                        </ul>
                        <?php
                        if (!isset($_SESSION['user'])) {
                            echo '<form class="navbar-form pull-right" name="singin" action="php/servlet.php?action=singin" method="post">
                                        <input class="input-large" type="email" placeholder="Correo Electronico" name="email" id="email" required="required" />
                                        <input class="span2" type="password" placeholder="Contraseña" name="passwd" id="passwd" required="required" />
                                        <button type="submit" class="btn btn-primary"><i class="icon-ok-sign icon-white"></i> Ingresar</button>
                                      </form>';
                        } else {
                            echo '<ul class="nav">
                                    <li><a></a></li><li><a></a></li><li><a></a></li><li><a></a></li>';
                            if ($user->getRolperson() == 0) {
                                echo '<li><a></a></li><li><a></a></li><li><a></a></li><li class="right"><a href="php/adm/menuadm.php">';
                            }
                            if ($user->getRolperson() == 1) {
                                echo '<li><a></a></li><li><a></a></li><li><a></a></li><li class="right"><a href="php/user/menuUser.php">';
                            }
                            echo $user->getMail();
                            echo '</a></li>
                                 </ul>
                                 <form class="navbar-form pull-right" name="" action="php/closeConexion.php" method="post" >
                                    <button type="submit" class="btn btn-danger"><i class="icon-remove-sign  icon-white"></i> Cerrar Session</button>
                                 </form>';
                        }
                        ?>
                    </div>
                </div>
            </div>
        </div>
        <br><br>
        <div class="container">
            <div class="row-fluid">
                <div class="span1"></div>
                <div class="span6"></div>
                <div class="span4">
                    <div class="hero-unit">
                        <h2 align="center">Registro</h2>
                        <p>Para acceder a la aplicacion registra tus datos en nuestro sistema y con ella podras tener control de tu ganado,
                            realizando las consultas que te arrojen los mejores resultados y sugerencias.</p>
                        <?php
                        if (!isset($_SESSION['user'])) {
                            echo '<div align="right"><a href="#modalRegisterUser" rol="button" class="btn btn-primary" data-toggle="modal">Reg&iacute;strate !!</a></div>';
                        } else {
                            echo '<div></div>';
                        }
                        ?>
                        <br><br><br><br>
                    </div>
                    <div id="modalRegisterUser" class="modal hide fade" >
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-hiden="true">x</button>
                            <h3>Registro</h3>
                            <small>Puedes registrarte en nuestra web, y hacer parte de este nuevo metodo ...</small>
                        </div>
                        <div class="modal-body">
                            <form action="php/servlet.php?action=register" name="register" method="post" class="form-horizontal" onsubmit="return validatePerson(document);">
                                <table>
                                    <tbody>
                                        <tr>
                                            <td><label for="name" class="control-label">Nombres:</label></td>
                                            <td><input type="text" name="name" id="name" required="required" /></td>
                                        </tr>
                                        <tr>
                                            <td><label for="last_name" class="control-label">Apellidos:</label></td>
                                            <td><input type="text" name="last_name" id="last_name" required="required" /></td>
                                        </tr>
                                        <tr>
                                            <td><label for="doctype" class="control-label">Tipo de Documento:</label></td>
                                            <td><select name="doctype" id="doctype" required="required">
                                                    <option value="" selected>- Tipo de Documento -</option>
                                                    <option value="CC">CC</option>
                                                    <option value="CE">CE</option>
                                                    <option value="PT">PT</option>
                                                    <option value="NIT">NIT</option>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td><label for="numdoc" class="control-label">Numero de Documento:</label></td>
                                            <td><input type="text" name="numdoc" id="numdoc" required="required" /></td>
                                        </tr>
                                        <tr>
                                            <td><label for="email" class="control-label">Email:</label></td>
                                            <td><input type="email" name="email" id="email" placeholder="example@exaple.com" required="required" /></td>
                                        </tr>
                                        <tr>
                                            <td><label for="address" class="control-label">Direcci&oacute;n:</label></td>
                                            <td><input type="text" name="address" id="address" required="required" /></td>
                                        </tr>
                                        <tr>
                                            <td><label for="phone" class="control-label">Tel&eacute;fono:</label></td>
                                            <td><input type="tel" name="phone" id="phone" required="required" maxlength="10"/></td>
                                        </tr>
                                        <tr>
                                            <td><label for="pass_wd" class="control-label">Contraseña:</label></td>
                                            <td><input type="password" name="pass_wd" id="pass_wd" required="required" maxlength="10"/></td>
                                        </tr>
                                        <tr>
                                            <td><label for="passwd2" class="control-label">Repita su Contraseña:</label></td>
                                            <td><input type="password" name="passwd2" id="passwd2" required="required" maxlength="10"/></td>
                                        </tr>
                                    </tbody>
                                </table>
                                <br>
                                <div class="form-actions modal-footer" align="center">
                                    <button type="submit" class="btn btn-primary"><i class="icon-check icon-white"></i> Registrarse</button>
                                    <button type="button" class="btn btn-danger" data-dismiss="modal"><i class="icon-remove icon-white"></i> Cancelar</button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
                <div class="span1"></div>
            </div>
            <footer class="footer">
                <div class="container">
                    <small>	
                        <img src="img/unicor_logo.png">
                        <strong>	Universidad de Cordoba. Facultad de Ingen&iacute;erias :: Departamento de Ingen&iacute;eria de Sistemas y Telecomunicaciones</strong>
                        <br>
                        Dise&ntilde;ado y Desarrollado por: Mar&iacute;a Alejandra Teher&aacute;n &amp; Daniela Mu&ntilde;oz De La Rosa &copy;
                    </small>
                </div>
            </footer>
        </div>
        <script type="text/javascript" src="js/jquery.js"></script>
        <script type="text/javascript" src="js/bootstrap.js"></script>
        <script type="text/javascript" src="js/bootstrap-collapse.js"></script>
    </body>
</html>